/**
 *  Activity for splashing at the starting time of application.
 *  Author: Sumeet Guha
 * 	Date  : 29 May 2010
 */

package com.activities;

import com.adapters.db.ContentProviderDB;
import com.senditcertified.mail.MainActivity;
import com.senditcertified.mail.R;
import com.senditcertified.mail.R.id;
import com.senditcertified.mail.R.layout;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.LinearLayout;

public class SplashActivity extends Activity {

	private final Handler mHandler = new Handler();

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.splash_screen);
		LinearLayout linear_layout = (LinearLayout) findViewById(R.id.linear_layout);
		linear_layout.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {
				Intent mainIntent = new Intent(SplashActivity.this,
						MainActivity.class);
				SplashActivity.this.startActivity(mainIntent);
				SplashActivity.this.finish();

			}
		});
		// setDefaultVariables();
		/*
		 * new Thread(new Runnable() {
		 * 
		 * @Override public void run() { new
		 * FullImageLoader(SplashActivity.this).clearFullPicCache();
		 * 
		 * } }).start();
		 */
		/*
		 * mHandler.postDelayed(new Runnable(){ public void run() { Create an
		 * Intent that will start the Menu-Activity. Intent mainIntent = new
		 * Intent(SplashActivity.this,MainActivity.class);
		 * SplashActivity.this.startActivity(mainIntent);
		 * SplashActivity.this.finish(); } }, 2000);
		 */
	}

	/**
	 * Set the default variables
	 */
	/*
	 * private void setDefaultVariables() {
	 * 
	 * WindowManager windowManager =
	 * (WindowManager)this.getSystemService(Context.WINDOW_SERVICE); int height
	 * = windowManager.getDefaultDisplay().getHeight(); int width =
	 * windowManager.getDefaultDisplay().getWidth(); Log.v("Width "+width,
	 * "Height "+height); int POPUP_MARGIN = 0; if(height <= 320){ POPUP_MARGIN
	 * = 80; } else if(height > 320 && height <= 480) POPUP_MARGIN = 100; else
	 * if(height > 320 && height <= 800) POPUP_MARGIN = 120; else if(height >
	 * 800 && height <= 1200) POPUP_MARGIN = 120;
	 * 
	 * 
	 * AppPreferences pref = new AppPreferences(getApplicationContext());
	 * pref.saveIntegerValue(AppPreferences.POPUP_MARGIN, POPUP_MARGIN); }
	 */

}
